<?php

namespace app\beautiful\model\setting;

use app\common\model\CommonModel;



class PartnerDividendSettingModel extends CommonModel{

    protected  $name = 'beautiful_partner_dividend_setting';

    protected  $pk   = 'dividend_setting_id';

    public static function onBeforeInsert($model)
    {
        $model->set("add_time", date('Y-m-d H:i:s'));
        $model->set("add_ip", request()->ip());
    }
    public function getById($where,$filed,$json)
    {
        $query = $this->where($where)->field($filed);
        if($json) $query = $query->json([$json],true);
        $list = $query->find();
        if($list) $list = $list->toArray();

        return $list;
    }



}

